﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using Common;

namespace CNCSoft.ErpApps.TMS.longGiaoVu
{
    public partial class frmDanhSachDuHoc : Form
    {
        private SqlConnection conn = new SqlConnection(GlobalVariable.WSInfo.ConnectionString);
        private DataSet ds = new DataSet();

        public frmDanhSachDuHoc()
        {
            InitializeComponent();
        }

        private void frmDanhSachDuHoc_Load(object sender, EventArgs e)
        {
            LoadData();
        }

        #region "Coding"
        private void LoadData()
        {
            try
            {
                LoadEnquiry();
                gridControl_Data.DataSource = ds.Tables["TableEnquiry"];
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void LoadEnquiry()
        {
            try
            {
                string sql = @"select * from Enquiry where IsDuHoc = 1";
                SqlDataAdapter da = new SqlDataAdapter(sql, conn);
                da.Fill(ds, "TableEnquiry");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        #endregion
    }
}
